Node Action¶
A node action is a python script.
This script is formed by the concatenation of three parts:
- Project head script
- Type head script
- Node action script
Before the execution, some environment variables are set in this order:
- Graph variables: MGVPROJECTNAME, MGVPATTERNNAME, MGVGRAPHPATH, MGVGRAPHKEYS, MGVGRAPHNAME, MGVGRAPHFILEPATH and KEY*
- Graph custom variables
- Node variables: MGVNODEPATH, MGVNODENAME, MGVNODETYPE and MGVNODEVERSION
- Inputs, as MGVINPUTS or MGVINPUTS_OUT
- Project context
- Node type files
- Node parameters
- Node custom variables
See Variables for an exhaustive list of Mangrove auto generated variables.
Each variable is recursively resolved with the whole set. For example:
- user : toto
- graph name : tutu
- a node parameter : FOO = “$USER”
- a type file : OUT = “${MGVGRAPHNAME}/${FOO}/bar”
The resulting OUT value will be : “tutu/toto/bar”
Inputs variables:
If a node is from a type with a type file X, an environment variable X will be created.
If 3 nodes A, B and C are connected to a node D, with a type file X for A and B, and Y for C, an execution on node D will set :
- an environment variables MGVINPUTS = “X;Y”
- an environment variables MGVINPUTS_X = “X_VALUE_OF_A;X_VALUE_OF_B”
- an environment variables MGVINPUTS_Y = “Y_VALUE_OF_C”